package Observer;

import java.util.Observable;

/**   
* <p>被观察者对象 </p>  
* @author zhengjuntao 
* @date 2018年7月23日  
*/  
public class WeatherData extends Observable {
    private float temperature;
    private float humidity;
    private float pressure;
    
    public void measurmentsChanged() {
        setChanged();
        notifyObservers();
    }

    public void setMeasurements(float temperature,float humidity,float pressure) {
        this.pressure = pressure;
        this.temperature = temperature;
        this.humidity = humidity;
        measurmentsChanged();
    }

    public float getTemperature() {
        return temperature;
    }

    public float getHumidity() {
        return humidity;
    }

    public float getPressure() {
        return pressure;
    }
    
}
